﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RobotBattle2.Scripting;

namespace Tests.RobotBattle2.Rsl2 {
	public static class OperatorUtils {
		public static IEnumerable<string> GetOperatorFormat(BinaryOperator op) {
			switch (op) {
				case BinaryOperator.Add:
					yield return "{0} + {1}";
					break;
				case BinaryOperator.Subtract:
					yield return "{0} - {1}";
					break;
				case BinaryOperator.Multiply:
					yield return "{0} * {1}";
					break;
				case BinaryOperator.Divide:
					yield return "{0} / {1}";
					break;
				case BinaryOperator.Modulo:
					yield return "{0} % {1}";
					break;
				case BinaryOperator.Or:
					yield return "{0} or {1}";
					yield return "{0} || {1}";
					break;
				case BinaryOperator.And:
					yield return "{0} and {1}";
					yield return "{0} && {1}";
					break;
				case BinaryOperator.NotEqual:
					yield return "{0} <> {1}";
					yield return "{0} != {1}";
					break;
				case BinaryOperator.Equal:
					yield return "{0} == {1}";
					break;
				case BinaryOperator.GreaterEqual:
					yield return "{0} >= {1}";
					break;
				case BinaryOperator.Greater:
					yield return "{0} > {1}";
					break;
				case BinaryOperator.Less:
					yield return "{0} < {1}";
					break;
				case BinaryOperator.LessEqual:
					yield return "{0} <= {1}";
					break;
				default:
					throw new NotSupportedException();
			}
		}
	}
}
